package com.zhongkeruan.user.hystrix;

import com.zhongkeruan.common.model.Order;
import com.zhongkeruan.common.vo.Result;
import com.zhongkeruan.user.hystrix.impl.OrderHystrixImpl;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * @author yangyao
 * @Description: OrderHystrix
 * @date 2019/1/12 11:59
 */
@FeignClient(serviceId = "PROVIDER-ORDER",fallback = OrderHystrixImpl.class)
public interface OrderHystrix {

    @GetMapping("/orders/{userId}/orders")
    public Result getOrderListByUserId(@PathVariable("userId") Long userId);

    @PostMapping("/orders")
    public Result addOrder(@RequestBody Order order);
}
